import sys
import numpy as np
import ctypes

sys.path.append("../utils")

from utils import OpRunner, compare, verify_result
import time


def main():
    func = OpRunner("./build/libop.so", 3, pint_time=True)
    # func.op.run.argtypes = None

    minvalue = -10
    maxvalue = 10
    dim = 1
    shape = [2,3,2]
    for dtype in [np.float32]:
        input_x1 = np.random.uniform(minvalue, maxvalue, shape).astype(dtype)
        input_x2 = np.random.uniform(minvalue, maxvalue, shape).astype(dtype)
        output = np.ones(shape, dtype=dtype)
        func([input_x1, input_x2, dim, output], [-1])
        print(output)


if __name__ == "__main__":
    main()
